package com.yhsoft.benefitcard.controller;

import com.yhsoft.benefitcard.service.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
@Slf4j
@Api(tags = {"卡号列表文档导出"})
@RequestMapping("/benefitcard")
public class ReportController {
    @Autowired
    private ReportService reportService;
    //CardsInfoOutVo
    @GetMapping("/export")
    @ApiOperation("导出备卡批次卡号列表")
    public void Export(@RequestParam(value = "firstBatchNum", required = false) String firstBatchNum, HttpServletResponse response) throws IOException {
        reportService.exportBusinessData(firstBatchNum, response);
    }

    @GetMapping("/export2")
    @ApiOperation("导出激活批次卡号列表")
    public void Export2(@RequestParam(value = "batch2Num", required = false) String batch2Num, HttpServletResponse response) throws IOException {
        reportService.exportBusinessData2(batch2Num, response);
    }
}
